package com.csun.dsms.service.impl;

import com.csun.dsms.comment.core.support.BaseService;
import com.csun.dsms.mapper.DsmsUnitMapper;
import com.csun.dsms.model.domain.DsmsUnit;
import com.csun.dsms.service.DsmsUnitService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * @author chisj chisj@foxmail.com
 * @version 1.0.0
 * @date 2021-09-01 13:24
 * @description: TODO
 */
@Service
@Transactional
public class DsmsUnitServiceImpl extends BaseService<DsmsUnit> implements DsmsUnitService {

    @Resource
    private DsmsUnitMapper dsmsUnitMapper;
    /*
     *单位的查询
     * */
    @Override
    public List<DsmsUnit> query(DsmsUnit dsmsUnit) {
        return dsmsUnitMapper.query(dsmsUnit);
    }

    @Override
    public List<DsmsUnit> queryByCondition(DsmsUnit unit) {
        return dsmsUnitMapper.queryByCondition(unit);
    }
    /*
     * 查询已绑定单位
     * */
    @Override
    public Set<Long> unitExist() {
        return dsmsUnitMapper.unitExist();
    }

    //根据片区查询单位
    @Override
    public List<DsmsUnit> queryUnitByAreaId(Long areaId) {
        return dsmsUnitMapper.queryUnitByAreaId(areaId);
    }

    //查询镇
    @Override
    public Integer selectUnitByPid() {
        return dsmsUnitMapper.selectUnitByPid();
    }
}
